﻿using System;
using System.Data.SqlClient;

namespace IndividualTask
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if (Session["login"] != null)
            {
                Panel2.Visible = true;
                HyperLink5.Visible = false;
            }
            else
            {
                Panel2.Visible = false;
                HyperLink5.Visible = true;
            }

                try
                {
                    localhost.WebService web = new localhost.WebService();
                    CinemaTable.DataSource = web.GetCinema();
                    CinemaTable.DataBind();
                }
                catch (SqlException ex)
                {
                    Console.WriteLine("Error" + ex.Message);
                }
           
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Session.Abandon();
            Response.Redirect(Request.Path);
        }
    }
}